import './ChatSidebar.scss';
import { NavLink, useLocation } from 'react-router-dom';
export default (props: any) => {
    const loc = useLocation();
    return (
        <div className="component-chat-sidebar">
            <div className='sidebar-header'>
                <span>CompareGPT</span>
                <i className='bi bi-layout-sidebar' />
            </div>
            <div className='sidebar-nav'>
                {
                    props.data.map((item: any, index: number)=>{
                        return (
                            <NavLink className={`nav-link ${loc.pathname == ('/chat' + item.path) ? 'active': ''}`} to={'/chat' + item.path} key={index}>{item.label}</NavLink>
                        );
                    })
                }
            </div>
            <div className='sidebar-chats'>
                <div>聊天</div>
            </div>
            <div className='sidebar-use-info'>
                
            </div>
        </div>
    );
}